** ANALYSIS OF THE STANDARD CROSS-CULTURAL SAMPLE DATASET
** Does Land Quality Increase the Power of Traditional Leaders in Contemporary Africa?
** Journal of Politics
** Kate Baldwin and Joan Ricart-Huguet

clear all

* Global macros
global replication "C:\Users\jricart-huguet\Dropbox\research\Persistence_of_TAs\submission\JoP\replication"
global figures_tables "C:\Users\jricart-huguet\Dropbox\research\Persistence_of_TAs\submission\JoP\replication\figures_tables"
global esttabformat b(%8.2f) p(%8.2f) obs ar2(%8.2f) r2(%8.2f) star(+ 0.10 * 0.05 ** 0.01)
cd "$replication"

use "$replication\SCCS_data.dta", clear

ssc install revrs
revrs v759 // reverse code v759 for consistency with v33 and outcome variable in Afrobarometer Round 4

** ANALYSIS 

* Bivariate models
eststo SSA: reg revv759 v924 if v1858 == 1 | inlist(socname,"Amhara","Bogo","Kenuzi Nubians","Teda","Tuareg")
eststo REST: reg revv759 v924 if v1858 != 1 & !inlist(socname,"Amhara","Bogo","Kenuzi Nubians","Teda","Tuareg") 

* "Equivalent" models to our baseline contemporary models in analysis.do but using SCCS data
eststo SSA1: reg revv759 v924 if v1858 == 1  | inlist(socname,"Amhara","Bogo","Kenuzi Nubians","Teda","Tuareg")
eststo SSA2: reg revv759 v924 v156 if v1858 == 1 | inlist(socname,"Amhara","Bogo","Kenuzi Nubians","Teda","Tuareg")
eststo SSA3: reg revv759 v924 v156 v237 latitude longitud if v1858 == 1 | inlist(socname,"Amhara","Bogo","Kenuzi Nubians","Teda","Tuareg")
eststo rest1: reg revv759 v924 if v1858 != 1 & !inlist(socname,"Amhara","Bogo","Kenuzi Nubians","Teda","Tuareg") 
eststo rest2: reg revv759 v924 v156 if v1858 != 1 & !inlist(socname,"Amhara","Bogo","Kenuzi Nubians","Teda","Tuareg") 
eststo rest3: reg revv759 v924 v237 v156 latitude longitud if v1858 != 1 & !inlist(socname,"Amhara","Bogo","Kenuzi Nubians","Teda","Tuareg") 
esttab SSA1 SSA2 SSA3 rest1 rest2 rest3, order(v924) $esttabformat

* Figure 1. Coefplot SSA vs. REST 
coefplot SSA || REST, ///
keep(v924) ///
yline(0, lcolor(black) lpattern(dash)) vertical bycoefs /// 
bylabels("Sub-Saharan African societies" "All other societies in the SCCS") levels(95 90) coeflabels(, labsize(vlarge)) /// 
msize(vlarge) ysize(2.5) ///
ytitle("Bivariate regression coefficients", size(vlarge)) 
///
graph play "$replication\coefplotwhite.grec"
graph export "$figures_tables\SCCS_v759_v924_SSAvsRest.pdf", replace

* Table A.1. SSA vs. REST
preserve
cd "$figures_tables"
label var v924 "Pre-colonial suitability of Soil for Agriculture"
label var v156 "Pre-colonial population density"
label var v237 "Pre-colonial political centralization"
esttab SSA1 SSA2 SSA3 rest1 rest2 rest3 using SSA_rest.tex, replace label /// 
mgroups("Sub-Saharan African societies" "All other societies", pattern(1 0 0 1 0 0) /// 
prefix(\multicolumn{@span}{c}{) suffix(}) span erepeat(\cmidrule(lr){@span})) /// 
varlabels(, elist(v924 \hline v156 \hline)) /// 
nomtitles /// 
nonotes star(\dag 0.10 * 0.05 ** 0.01) /// 
order(v924 v156) nocons /// 
b(2) se(2) stats(N r2 r2_a, fmt(0 2) labels("Societies (N)" "\(R^{2}\)" "Adj. \(R^{2}\)")) //
cd "$data"
restore

